<template>
    <div class="new_album">
        <!-- 新碟上架列表 -->
        <div class="album_list">
            <ul>
                <li v-for="(item, index) in newlist" :key="index">
                    <div class="info" @click="$router.push(`/albumlist/${item.id}`)">
                        <img :src="item.picUrl" alt="" style="width:130px;">
                        <i :title="item.name" class="mask"></i>
                        <div class="show">
                            <i class="play"></i>
                        </div>
                    </div>
                    <p :title="item.name" class="dec ellipsis" @click="$router.push(`/albumlist/${item.id}`)">{{ item.name }}</p>
                    <span :title="item.artist.name" class="name" @click="$router.push(`/artlist/${item.artist.id}`)">{{ item.artist.name }}</span>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
export default {
    data () {
        return {

        }
    },
    props: ["newlist"],
}
</script>
 
<style lang = "less" scoped>
@import "../../assets/base.less";
.new_album {
    .titles {
        height: 40px;
        width: 100%;
        border-bottom: 2px solid @red;
        display: flex;
        align-items: center;
        h2 {
            font-size: 24px;
            color: #333;
            cursor: pointer;
            &:hover {
                text-decoration: underline;
            }
        }
        ul {
            display: flex;
            align-items: center;
            li {
                cursor: pointer;
                font-size: 12px;
                color: #666;
                border-right: 1px solid #666;
                padding: 0 15px;
                &:last-of-type {
                    border: none;
                }
                &:hover {
                    text-decoration: underline;
                    color: #666;
                }
            }
        }
        .more {
            cursor: pointer;
            a {
                font-size: 12px;
                color: #666;
                &:hover {
                    text-decoration: underline;
                }
            }
            img {
                margin: auto;
                padding: 0 5px;
            }
        }
    }
    .album_list {
        ul {
            flex-wrap: wrap;
            display: flex;
            justify-content: space-between !important;
            padding-bottom: 30px;
        }
        li {
            cursor: pointer;
            width: 160px;
            height: 180px;
            margin-top: 20px;
            line-height: 1.5;
            &:nth-of-type(5n) {
                margin-right: 0;
            }
            .info {
                position: relative;
                height: 130px;
                width: 160px;
                overflow: hidden;
                .mask {
                    position: absolute;
                    top: 0;
                    left: 0;
                    height: 130px;
                    width: 160px;
                    display: block;
                    background: url("../../assets/images/public/coverall.png") no-repeat 0px -845px;
                }
                &:hover {
                    .show {
                        display: block;
                    }
                    img {
                        transform: scale(1.1);
                    }
                }
                .show {
                    display: none;
                    i {
                        position: absolute;
                        bottom: 5px;
                        right: 40px;
                        height: 30px;
                        width: 30px;
                        display: block;;
                        float: right;
                        background: url("../../assets/images/public/iconall.png") no-repeat;
                    }
                    .play {
                        background-position: 0px -140px;
                        &:hover {
                            background-position: 0px -170px;
                        }
                    }
                }
            }
            .dec {
                width: 100%;
                font-size: 14px;
                color: #000;
                &:hover {
                    text-decoration: underline;
                }
            }
            .name {
                font-size: 12px;
                color: #666;
                &:hover {
                    text-decoration: underline;
                    color: #666;
                }
            }
        }
    }
}
</style>